#include<iostream>
#include<boost/regex.hpp>
#include<string>

using namespace std;
using namespace boost;
int main(int argc,char **argv)
{

  boost::regex reg("/^(\S+) (\S+) (\S+) \[([^:]+):(\d+:\d+:\d+) ([^\]]+)\] \"(\S+) (.*?) (\S+)\" (\S+) (\S+) (\".*?\") (\".*?\")$/");
  boost::smatch m;
  string s("172.27.30.163 - - [07/Aug/2013:15:18:11 +0800] "GET /index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1" 200 2524");

  if(boost::regex_search(s,m,reg)){
    if(m[1].matched)
      cout<<m[1]<<endl;
    if(m[2].matched)
      cout<<m[2]<<endl;
  }
}






